home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Sound.p < prev    next >
Text File  |  1996-05-01  |  24KB  |  679 lines

  1. {
  2.      File:        Sound.p
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    Sound Manager 3.1
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Sound;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SOUND__}
  28. {$SETC __SOUND__ := 1}
  29.  
  30. {$I+}
  31. {$SETC SoundIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __COMPONENTS__}
  38. {$I Components.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MIXEDMODE__}
  41. {$I MixedMode.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  49. {
  50.                         * * *  N O T E  * * *
  51.  
  52.     This file has been updated to include Sound Manager 3.2 interfaces.
  53.  
  54.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  55.     that originally shipped with the PowerMacs. These missing functions and the
  56.     new 3.2 interfaces have been released in the SoundLib library for PowerPC
  57.     developers to link with. The runtime library for these functions are
  58.     installed by Sound Manager 3.2. The following functions are found in SoundLib.
  59.  
  60.         GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  61.         UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  62.         SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  63.         SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  64.         SoundConverterConvertBuffer(), SoundConverterEndConversion()
  65. }
  66. {
  67.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  68.  
  69.     These items are no longer defined, but appear here so that someone
  70.     searching the interfaces might find them. If you are using one of these
  71.     items, you must change your code to support the Sound Manager.
  72.  
  73.         swMode, ftMode, ffMode
  74.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  75.         SndCompletionProcPtr
  76.         StartSound, StopSound, SoundDone
  77. }
  78.  
  79. CONST
  80.     soundListRsrc                = 'snd ';                        { Resource type used by Sound Manager }
  81.     rate44khz                    = $AC440000;                    { 44100.00000 in fixed-point }
  82.     rate22050hz                    = $56220000;                    { 22050.00000 in fixed-point }
  83.     rate22khz                    = $56EE8BA3;                    { 22254.54545 in fixed-point }
  84.     rate11khz                    = $2B7745D1;                    { 11127.27273 in fixed-point }
  85.     rate11025hz                    = $2B110000;                    { 11025.00000 in fixed-point }
  86.                                                                 { synthesizer numbers for SndNewChannel }
  87.     squareWaveSynth                = 1;                            { square wave synthesizer }
  88.     waveTableSynth                = 3;                            { wave table synthesizer }
  89.     sampledSynth                = 5;                            { sampled sound synthesizer }
  90.                                                                 { old Sound Manager MACE synthesizer numbers }
  91.     MACE3snthID                    = 11;
  92.     MACE6snthID                    = 13;
  93.     kMiddleC                    = 60;                            { MIDI note value for middle C }
  94.     kSimpleBeepID                = 1;                            { reserved resource ID for Simple Beep }
  95.     kFullVolume                    = $0100;                        { 1.0, setting for full hardware output volume }
  96.     kNoVolume                    = 0;                            { setting for no sound volume }
  97.                                                                 { command numbers for SndDoCommand and SndDoImmediate }
  98.     nullCmd                        = 0;
  99.     initCmd                        = 1;
  100.     freeCmd                        = 2;
  101.     quietCmd                    = 3;
  102.     flushCmd                    = 4;
  103.     reInitCmd                    = 5;
  104.     waitCmd                        = 10;
  105.     pauseCmd                    = 11;
  106.     resumeCmd                    = 12;
  107.     callBackCmd                    = 13;
  108.  
  109.     syncCmd                        = 14;
  110.     availableCmd                = 24;
  111.     versionCmd                    = 25;
  112.     totalLoadCmd                = 26;
  113.     loadCmd                        = 27;
  114.     freqDurationCmd                = 40;
  115.     restCmd                        = 41;
  116.     freqCmd                        = 42;
  117.     ampCmd                        = 43;
  118.     timbreCmd                    = 44;
  119.     getAmpCmd                    = 45;
  120.     volumeCmd                    = 46;                            { sound manager 3.0 or later only }
  121.     getVolumeCmd                = 47;                            { sound manager 3.0 or later only }
  122.     waveTableCmd                = 60;
  123.     phaseCmd                    = 61;
  124.  
  125.     soundCmd                    = 80;
  126.     bufferCmd                    = 81;
  127.     rateCmd                        = 82;
  128.     continueCmd                    = 83;
  129.     doubleBufferCmd                = 84;
  130.     getRateCmd                    = 85;
  131.     rateMultiplierCmd            = 86;
  132.     getRateMultiplierCmd        = 87;
  133.     sizeCmd                        = 90;                            { obsolete command }
  134.     convertCmd                    = 91;                            { obsolete MACE command }
  135.     stdQLength                    = 128;
  136.     dataOffsetFlag                = $8000;
  137.  
  138. { channel initialization parameters }
  139. {$IFC OLDROUTINENAMES }
  140.     waveInitChannelMask            = $07;
  141.     waveInitChannel0            = $04;                            { wave table only, Sound Manager 2.0 and earlier }
  142.     waveInitChannel1            = $05;                            { wave table only, Sound Manager 2.0 and earlier }
  143.     waveInitChannel2            = $06;                            { wave table only, Sound Manager 2.0 and earlier }
  144.     waveInitChannel3            = $07;                            { wave table only, Sound Manager 2.0 and earlier }
  145.     initChan0                    = $04;                            { obsolete spelling }
  146.     initChan1                    = $05;                            { obsolete spelling }
  147.     initChan2                    = $06;                            { obsolete spelling }
  148.     initChan3                    = $07;                            { obsolete spelling }
  149.  
  150. {$ENDC}
  151.     initChanLeft                = $0002;                        { left stereo channel }
  152.     initChanRight                = $0003;                        { right stereo channel }
  153.     initNoInterp                = $0004;                        { no linear interpolation }
  154.     initNoDrop                    = $0008;                        { no drop-sample conversion }
  155.     initMono                    = $0080;                        { monophonic channel }
  156.     initStereo                    = $00C0;                        { stereo channel }
  157.     initMACE3                    = $0300;                        { MACE 3:1 }
  158.     initMACE6                    = $0400;                        { MACE 6:1 }
  159.     initPanMask                    = $0003;                        { mask for right/left pan values }
  160.     initSRateMask                = $0030;                        { mask for sample rate values }
  161.     initStereoMask                = $00C0;                        { mask for mono/stereo values }
  162.     initCompMask                = $FF00;                        { mask for compression IDs }
  163.     kUseOptionalOutputDevice    = -1;                            { only for Sound Manager 3.0 or later }
  164.     notCompressed                = 0;                            { compression ID's }
  165.     fixedCompression            = -1;                            { compression ID for fixed-sized compression }
  166.     variableCompression            = -2;                            { compression ID for variable-sized compression }
  167.     twoToOne                    = 1;
  168.     eightToThree                = 2;
  169.     threeToOne                    = 3;
  170.     sixToOne                    = 4;
  171.  
  172.     stdSH                        = $00;                            { Standard sound header encode value }
  173.     extSH                        = $FF;                            { Extended sound header encode value }
  174.     cmpSH                        = $FE;                            { Compressed sound header encode value }
  175.  
  176.     outsideCmpSH                = 0;                            { obsolete MACE constant }
  177.     insideCmpSH                    = 1;                            { obsolete MACE constant }
  178.     aceSuccess                    = 0;                            { obsolete MACE constant }
  179.     aceMemFull                    = 1;                            { obsolete MACE constant }
  180.     aceNilBlock                    = 2;                            { obsolete MACE constant }
  181.     aceBadComp                    = 3;                            { obsolete MACE constant }
  182.     aceBadEncode                = 4;                            { obsolete MACE constant }
  183.     aceBadDest                    = 5;                            { obsolete MACE constant }
  184.     aceBadCmd                    = 6;                            { obsolete MACE constant }
  185.     sixToOnePacketSize            = 8;
  186.     threeToOnePacketSize        = 16;
  187.     stateBlockSize                = 64;
  188.     leftOverBlockSize            = 32;
  189.     firstSoundFormat            = $0001;                        { general sound format }
  190.     secondSoundFormat            = $0002;                        { special sampled sound format (HyperCard) }
  191.     dbBufferReady                = $00000001;                    { double buffer is filled }
  192.     dbLastBuffer                = $00000004;                    { last double buffer to play }
  193.     sysBeepDisable                = $0000;                        { SysBeep() enable flags }
  194.     sysBeepEnable                = $01;
  195.     sysBeepSynchronous            = $02;                            { if bit set, make alert sounds synchronous }
  196.     unitTypeNoSelection            = $FFFF;                        { unitTypes for AudioSelection.unitType }
  197.     unitTypeSeconds                = $0000;
  198.  
  199. CONST twelfthRootTwo = 1.05946309435;
  200.  
  201. { unsigned fixed-point number }
  202.  
  203. TYPE
  204.     UnsignedFixed                        = LONGINT;
  205.     SndCommandPtr = ^SndCommand;
  206.     SndCommand = PACKED RECORD
  207.         cmd:                    INTEGER;
  208.         param1:                    INTEGER;
  209.         param2:                    LONGINT;
  210.     END;
  211.  
  212.     SndChannelPtr = ^SndChannel;
  213.     SndCallBackProcPtr = ProcPtr;  { PROCEDURE SndCallBack(chan: SndChannelPtr; VAR cmd: SndCommand); }
  214.  
  215.     SndCallBackUPP = UniversalProcPtr;
  216.     SndChannel = PACKED RECORD
  217.         nextChan:                SndChannelPtr;
  218.         firstMod:                Ptr;                                    {  reserved for the Sound Manager  }
  219.         callBack:                SndCallBackUPP;
  220.         userInfo:                LONGINT;
  221.         wait:                    LONGINT;                                {  The following is for internal Sound Manager use only. }
  222.         cmdInProgress:            SndCommand;
  223.         flags:                    INTEGER;
  224.         qLength:                INTEGER;
  225.         qHead:                    INTEGER;
  226.         qTail:                    INTEGER;
  227.         queue:                    ARRAY [0..127] OF SndCommand;
  228.     END;
  229.  
  230. { MACE structures }
  231.     StateBlockPtr = ^StateBlock;
  232.     StateBlock = RECORD
  233.         stateVar:                ARRAY [0..63] OF INTEGER;
  234.     END;
  235.  
  236.     LeftOverBlockPtr = ^LeftOverBlock;
  237.     LeftOverBlock = RECORD
  238.         count:                    LONGINT;
  239.         sampleArea:                ARRAY [0..31] OF SInt8;
  240.     END;
  241.  
  242.     ModRefPtr = ^ModRef;
  243.     ModRef = RECORD
  244.         modNumber:                INTEGER;
  245.         modInit:                LONGINT;
  246.     END;
  247.  
  248.     SndListResourcePtr = ^SndListResource;
  249.     SndListResource = RECORD
  250.         format:                    INTEGER;
  251.         numModifiers:            INTEGER;
  252.         modifierPart:            ARRAY [0..0] OF ModRef;
  253.         numCommands:            INTEGER;
  254.         commandPart:            ARRAY [0..0] OF SndCommand;
  255.         dataPart:                SInt8;
  256.     END;
  257.  
  258.     SndListPtr                            = ^SndListResource;
  259.     SndListHndl                            = ^SndListPtr;
  260.     SndListHandle                        = ^SndListPtr;
  261. { HyperCard sound resource format }
  262.     Snd2ListResourcePtr = ^Snd2ListResource;
  263.     Snd2ListResource = RECORD
  264.         format:                    INTEGER;
  265.         refCount:                INTEGER;
  266.         numCommands:            INTEGER;
  267.         commandPart:            ARRAY [0..0] OF SndCommand;
  268.         dataPart:                SInt8;
  269.     END;
  270.  
  271.     Snd2ListPtr                            = ^Snd2ListResource;
  272.     Snd2ListHndl                        = ^Snd2ListPtr;
  273.     Snd2ListHandle                        = ^Snd2ListPtr;
  274.     SoundHeaderPtr = ^SoundHeader;
  275.     SoundHeader = PACKED RECORD
  276.         samplePtr:                Ptr;                                    { if NIL then samples are in sampleArea }
  277.         length:                    LONGINT;                                { length of sound in bytes }
  278.         sampleRate:                UnsignedFixed;                            { sample rate for this sound }
  279.         loopStart:                LONGINT;                                { start of looping portion }
  280.         loopEnd:                LONGINT;                                { end of looping portion }
  281.         encode:                    UInt8;                                    { header encoding }
  282.         baseFrequency:            UInt8;                                    { baseFrequency value }
  283.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  284.     END;
  285.  
  286.     CmpSoundHeaderPtr = ^CmpSoundHeader;
  287.     CmpSoundHeader = PACKED RECORD
  288.         samplePtr:                Ptr;                                    { if nil then samples are in sample area }
  289.         numChannels:            LONGINT;                                { number of channels i.e. mono = 1 }
  290.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  291.         loopStart:                LONGINT;                                { loopStart of sound before compression }
  292.         loopEnd:                LONGINT;                                { loopEnd of sound before compression }
  293.         encode:                    UInt8;                                    { data structure used , stdSH, extSH, or cmpSH }
  294.         baseFrequency:            UInt8;                                    { same meaning as regular SoundHeader }
  295.         numFrames:                LONGINT;                                { length in frames ( packetFrames or sampleFrames ) }
  296.         AIFFSampleRate:            extended80;                                { IEEE sample rate }
  297.         markerChunk:            Ptr;                                    { sync track }
  298.         format:                    OSType;                                    { data format type, was futureUse1 }
  299.         futureUse2:                LONGINT;                                { reserved by Apple }
  300.         stateVars:                StateBlockPtr;                            { pointer to State Block }
  301.         leftOverSamples:        LeftOverBlockPtr;                        { used to save truncated samples between compression calls }
  302.         compressionID:            INTEGER;                                { 0 means no compression, non zero means compressionID }
  303.         packetSize:                INTEGER;                                { number of bits in compressed sample packet }
  304.         snthID:                    INTEGER;                                { resource ID of Sound Manager snth that contains NRT C/E }
  305.         sampleSize:                INTEGER;                                { number of bits in non-compressed sample }
  306.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  307.     END;
  308.  
  309.     ExtSoundHeaderPtr = ^ExtSoundHeader;
  310.     ExtSoundHeader = PACKED RECORD
  311.         samplePtr:                Ptr;                                    { if nil then samples are in sample area }
  312.         numChannels:            LONGINT;                                { number of channels,  ie mono = 1 }
  313.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  314.         loopStart:                LONGINT;                                { same meaning as regular SoundHeader }
  315.         loopEnd:                LONGINT;                                { same meaning as regular SoundHeader }
  316.         encode:                    UInt8;                                    { data structure used , stdSH, extSH, or cmpSH }
  317.         baseFrequency:            UInt8;                                    { same meaning as regular SoundHeader }
  318.         numFrames:                LONGINT;                                { length in total number of frames }
  319.         AIFFSampleRate:            extended80;                                { IEEE sample rate }
  320.         markerChunk:            Ptr;                                    { sync track }
  321.         instrumentChunks:        Ptr;                                    { AIFF instrument chunks }
  322.         AESRecording:            Ptr;
  323.         sampleSize:                INTEGER;                                { number of bits in sample }
  324.         futureUse1:                INTEGER;                                { reserved by Apple }
  325.         futureUse2:                LONGINT;                                { reserved by Apple }
  326.         futureUse3:                LONGINT;                                { reserved by Apple }
  327.         futureUse4:                LONGINT;                                { reserved by Apple }
  328.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  329.     END;
  330.  
  331.     ConversionBlockPtr = ^ConversionBlock;
  332.     ConversionBlock = RECORD
  333.         destination:            INTEGER;
  334.         unused:                    INTEGER;
  335.         inputPtr:                CmpSoundHeaderPtr;
  336.         outputPtr:                CmpSoundHeaderPtr;
  337.     END;
  338.  
  339.     SMStatusPtr = ^SMStatus;
  340.     SMStatus = PACKED RECORD
  341.         smMaxCPULoad:            INTEGER;
  342.         smNumChannels:            INTEGER;
  343.         smCurCPULoad:            INTEGER;
  344.     END;
  345.  
  346.     SCStatusPtr = ^SCStatus;
  347.     SCStatus = RECORD
  348.         scStartTime:            UnsignedFixed;
  349.         scEndTime:                UnsignedFixed;
  350.         scCurrentTime:            UnsignedFixed;
  351.         scChannelBusy:            BOOLEAN;
  352.         scChannelDisposed:        BOOLEAN;
  353.         scChannelPaused:        BOOLEAN;
  354.         scUnused:                BOOLEAN;
  355.         scChannelAttributes:    LONGINT;
  356.         scCPULoad:                LONGINT;
  357.     END;
  358.  
  359.     AudioSelectionPtr = ^AudioSelection;
  360.     AudioSelection = PACKED RECORD
  361.         unitType:                LONGINT;
  362.         selStart:                UnsignedFixed;
  363.         selEnd:                    UnsignedFixed;
  364.     END;
  365.  
  366.     FilePlayCompletionProcPtr = ProcPtr;  { PROCEDURE FilePlayCompletion(chan: SndChannelPtr); }
  367.  
  368.     FilePlayCompletionUPP = UniversalProcPtr;
  369.  
  370. CONST
  371.     uppFilePlayCompletionProcInfo = $000000C0;
  372.  
  373. FUNCTION NewFilePlayCompletionProc(userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  374.     {$IFC NOT GENERATINGCFM }
  375.     INLINE $2E9F;
  376.     {$ENDC}
  377.  
  378. PROCEDURE CallFilePlayCompletionProc(chan: SndChannelPtr; userRoutine: FilePlayCompletionUPP);
  379.     {$IFC NOT GENERATINGCFM}
  380.     INLINE $205F, $4E90;
  381.     {$ENDC}
  382.  
  383. TYPE
  384.     SndDoubleBufferPtr = ^SndDoubleBuffer;
  385.     SndDoubleBuffer = PACKED RECORD
  386.         dbNumFrames:            LONGINT;
  387.         dbFlags:                LONGINT;
  388.         dbUserInfo:                ARRAY [0..1] OF LONGINT;
  389.         dbSoundData:            ARRAY [0..0] OF SInt8;
  390.     END;
  391.  
  392.     SndDoubleBackProcPtr = ProcPtr;  { PROCEDURE SndDoubleBack(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr); }
  393.  
  394.     SndDoubleBackUPP = UniversalProcPtr;
  395.  
  396. CONST
  397.     uppSndDoubleBackProcInfo = $000003C0;
  398.  
  399. FUNCTION NewSndDoubleBackProc(userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  400.     {$IFC NOT GENERATINGCFM }
  401.     INLINE $2E9F;
  402.     {$ENDC}
  403.  
  404. PROCEDURE CallSndDoubleBackProc(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr; userRoutine: SndDoubleBackUPP);
  405.     {$IFC NOT GENERATINGCFM}
  406.     INLINE $205F, $4E90;
  407.     {$ENDC}
  408.  
  409. TYPE
  410.     SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  411.     SndDoubleBufferHeader = PACKED RECORD
  412.         dbhNumChannels:            INTEGER;
  413.         dbhSampleSize:            INTEGER;
  414.         dbhCompressionID:        INTEGER;
  415.         dbhPacketSize:            INTEGER;
  416.         dbhSampleRate:            UnsignedFixed;
  417.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  418.         dbhDoubleBack:            SndDoubleBackUPP;
  419.     END;
  420.  
  421.     SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  422.     SndDoubleBufferHeader2 = PACKED RECORD
  423.         dbhNumChannels:            INTEGER;
  424.         dbhSampleSize:            INTEGER;
  425.         dbhCompressionID:        INTEGER;
  426.         dbhPacketSize:            INTEGER;
  427.         dbhSampleRate:            UnsignedFixed;
  428.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  429.         dbhDoubleBack:            SndDoubleBackUPP;
  430.         dbhFormat:                OSType;
  431.     END;
  432.  
  433.     SoundInfoListPtr = ^SoundInfoList;
  434.     SoundInfoList = PACKED RECORD
  435.         count:                    INTEGER;
  436.         infoHandle:                Handle;
  437.     END;
  438.  
  439.     SoundComponentDataPtr = ^SoundComponentData;
  440.     SoundComponentData = RECORD
  441.         flags:                    LONGINT;
  442.         format:                    OSType;
  443.         numChannels:            INTEGER;
  444.         sampleSize:                INTEGER;
  445.         sampleRate:                UnsignedFixed;
  446.         sampleCount:            LONGINT;
  447.         buffer:                    Ptr;
  448.         reserved:                LONGINT;
  449.     END;
  450.  
  451.     CompressionInfoPtr = ^CompressionInfo;
  452.     CompressionInfo = RECORD
  453.         recordSize:                LONGINT;
  454.         format:                    OSType;
  455.         compressionID:            INTEGER;
  456.         samplesPerPacket:        INTEGER;
  457.         bytesPerPacket:            INTEGER;
  458.         bytesPerFrame:            INTEGER;
  459.         bytesPerSample:            INTEGER;
  460.         futureUse1:                INTEGER;
  461.     END;
  462.  
  463.     CompressionInfoHandle                = ^CompressionInfoPtr;
  464. { private thing to use as a reference to a Sound Converter }
  465.     SoundConverter = ^LONGINT;
  466. {$IFC FOR_SYSTEM7_ONLY }
  467. {
  468.  These two routines for Get/SetSoundVol should no longer be used.
  469.  They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  470.  Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  471. }
  472. {$IFC OLDROUTINENAMES AND NOT GENERATINGCFM }
  473. PROCEDURE SetSoundVol(level: INTEGER);
  474. PROCEDURE GetSoundVol(VAR level: INTEGER);
  475.     {$IFC NOT GENERATINGCFM}
  476.     INLINE $205F, $4218, $10B8, $0260;
  477.     {$ENDC}
  478. {$ENDC}
  479. {$ENDC}
  480. PROCEDURE SysBeep(duration: INTEGER);
  481.     {$IFC NOT GENERATINGCFM}
  482.     INLINE $A9C8;
  483.     {$ENDC}
  484. FUNCTION SndDoCommand(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand; noWait: BOOLEAN): OSErr;
  485.     {$IFC NOT GENERATINGCFM}
  486.     INLINE $A803;
  487.     {$ENDC}
  488. FUNCTION SndDoImmediate(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand): OSErr;
  489.     {$IFC NOT GENERATINGCFM}
  490.     INLINE $A804;
  491.     {$ENDC}
  492. FUNCTION SndNewChannel(VAR chan: SndChannelPtr; synth: INTEGER; init: LONGINT; userRoutine: SndCallBackUPP): OSErr;
  493.     {$IFC NOT GENERATINGCFM}
  494.     INLINE $A807;
  495.     {$ENDC}
  496. FUNCTION SndDisposeChannel(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  497.     {$IFC NOT GENERATINGCFM}
  498.     INLINE $A801;
  499.     {$ENDC}
  500. FUNCTION SndPlay(chan: SndChannelPtr; sndHandle: SndListHandle; async: BOOLEAN): OSErr;
  501.     {$IFC NOT GENERATINGCFM}
  502.     INLINE $A805;
  503.     {$ENDC}
  504. {$IFC OLDROUTINENAMES }
  505. FUNCTION SndAddModifier(chan: SndChannelPtr; modifier: Ptr; id: INTEGER; init: LONGINT): OSErr;
  506.     {$IFC NOT GENERATINGCFM}
  507.     INLINE $A802;
  508.     {$ENDC}
  509. {$ENDC}
  510. FUNCTION SndControl(id: INTEGER; VAR cmd: SndCommand): OSErr;
  511.     {$IFC NOT GENERATINGCFM}
  512.     INLINE $A806;
  513.     {$ENDC}
  514. {  Sound Manager 2.0 and later, uses _SoundDispatch  }
  515. FUNCTION SndSoundManagerVersion: NumVersion;
  516.     {$IFC NOT GENERATINGCFM}
  517.     INLINE $203C, $000C, $0008, $A800;
  518.     {$ENDC}
  519. FUNCTION SndStartFilePlay(chan: SndChannelPtr; fRefNum: INTEGER; resNum: INTEGER; bufferSize: LONGINT; theBuffer: UNIV Ptr; theSelection: AudioSelectionPtr; theCompletion: FilePlayCompletionUPP; async: BOOLEAN): OSErr;
  520.     {$IFC NOT GENERATINGCFM}
  521.     INLINE $203C, $0D00, $0008, $A800;
  522.     {$ENDC}
  523. FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr;
  524.     {$IFC NOT GENERATINGCFM}
  525.     INLINE $203C, $0204, $0008, $A800;
  526.     {$ENDC}
  527. FUNCTION SndStopFilePlay(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  528.     {$IFC NOT GENERATINGCFM}
  529.     INLINE $203C, $0308, $0008, $A800;
  530.     {$ENDC}
  531. FUNCTION SndChannelStatus(chan: SndChannelPtr; theLength: INTEGER; theStatus: SCStatusPtr): OSErr;
  532.     {$IFC NOT GENERATINGCFM}
  533.     INLINE $203C, $0510, $0008, $A800;
  534.     {$ENDC}
  535. FUNCTION SndManagerStatus(theLength: INTEGER; theStatus: SMStatusPtr): OSErr;
  536.     {$IFC NOT GENERATINGCFM}
  537.     INLINE $203C, $0314, $0008, $A800;
  538.     {$ENDC}
  539. PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER);
  540.     {$IFC NOT GENERATINGCFM}
  541.     INLINE $203C, $0218, $0008, $A800;
  542.     {$ENDC}
  543. FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr;
  544.     {$IFC NOT GENERATINGCFM}
  545.     INLINE $203C, $011C, $0008, $A800;
  546.     {$ENDC}
  547. FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr; theParams: SndDoubleBufferHeaderPtr): OSErr;
  548.     {$IFC NOT GENERATINGCFM}
  549.     INLINE $203C, $0420, $0008, $A800;
  550.     {$ENDC}
  551. {  MACE compression routines  }
  552. FUNCTION MACEVersion: NumVersion;
  553.     {$IFC NOT GENERATINGCFM}
  554.     INLINE $203C, $0000, $0010, $A800;
  555.     {$ENDC}
  556. PROCEDURE Comp3to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  557.     {$IFC NOT GENERATINGCFM}
  558.     INLINE $203C, $0004, $0010, $A800;
  559.     {$ENDC}
  560. PROCEDURE Exp1to3(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  561.     {$IFC NOT GENERATINGCFM}
  562.     INLINE $203C, $0008, $0010, $A800;
  563.     {$ENDC}
  564. PROCEDURE Comp6to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  565.     {$IFC NOT GENERATINGCFM}
  566.     INLINE $203C, $000C, $0010, $A800;
  567.     {$ENDC}
  568. PROCEDURE Exp1to6(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  569.     {$IFC NOT GENERATINGCFM}
  570.     INLINE $203C, $0010, $0010, $A800;
  571.     {$ENDC}
  572. {  Sound Manager 3.0 and later calls  }
  573. FUNCTION GetSysBeepVolume(VAR level: LONGINT): OSErr;
  574.     {$IFC NOT GENERATINGCFM}
  575.     INLINE $203C, $0224, $0018, $A800;
  576.     {$ENDC}
  577. FUNCTION SetSysBeepVolume(level: LONGINT): OSErr;
  578.     {$IFC NOT GENERATINGCFM}
  579.     INLINE $203C, $0228, $0018, $A800;
  580.     {$ENDC}
  581. FUNCTION GetDefaultOutputVolume(VAR level: LONGINT): OSErr;
  582.     {$IFC NOT GENERATINGCFM}
  583.     INLINE $203C, $022C, $0018, $A800;
  584.     {$ENDC}
  585. FUNCTION SetDefaultOutputVolume(level: LONGINT): OSErr;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $203C, $0230, $0018, $A800;
  588.     {$ENDC}
  589. FUNCTION GetSoundHeaderOffset(sndHandle: SndListHandle; VAR offset: LONGINT): OSErr;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $203C, $0404, $0018, $A800;
  592.     {$ENDC}
  593. FUNCTION UnsignedFixedMulDiv(value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
  594.     {$IFC NOT GENERATINGCFM}
  595.     INLINE $203C, $060C, $0018, $A800;
  596.     {$ENDC}
  597. FUNCTION GetCompressionInfo(compressionID: INTEGER; format: OSType; numChannels: INTEGER; sampleSize: INTEGER; cp: CompressionInfoPtr): OSErr;
  598.     {$IFC NOT GENERATINGCFM}
  599.     INLINE $203C, $0710, $0018, $A800;
  600.     {$ENDC}
  601. FUNCTION SetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $203C, $0634, $0018, $A800;
  604.     {$ENDC}
  605. FUNCTION GetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  606.     {$IFC NOT GENERATINGCFM}
  607.     INLINE $203C, $0638, $0018, $A800;
  608.     {$ENDC}
  609. {  Sound Manager 3.1 and later calls  }
  610. FUNCTION SndGetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  611.     {$IFC NOT GENERATINGCFM}
  612.     INLINE $203C, $063C, $0018, $A800;
  613.     {$ENDC}
  614. FUNCTION SndSetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  615.     {$IFC NOT GENERATINGCFM}
  616.     INLINE $203C, $0640, $0018, $A800;
  617.     {$ENDC}
  618. FUNCTION GetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  619.     {$IFC NOT GENERATINGCFM}
  620.     INLINE $203C, $0644, $0018, $A800;
  621.     {$ENDC}
  622. FUNCTION SetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  623.     {$IFC NOT GENERATINGCFM}
  624.     INLINE $203C, $0648, $0018, $A800;
  625.     {$ENDC}
  626. {  Sound Manager 3.2 and later calls  }
  627. FUNCTION GetCompressionName(compressionType: OSType; VAR compressionName: Str255): OSErr;
  628.     {$IFC NOT GENERATINGCFM}
  629.     INLINE $203C, $044C, $0018, $A800;
  630.     {$ENDC}
  631. FUNCTION SoundConverterOpen({CONST}VAR inputFormat: SoundComponentData; {CONST}VAR outputFormat: SoundComponentData; VAR sc: SoundConverter): OSErr;
  632.     {$IFC NOT GENERATINGCFM}
  633.     INLINE $203C, $0650, $0018, $A800;
  634.     {$ENDC}
  635. FUNCTION SoundConverterClose(sc: SoundConverter): OSErr;
  636.     {$IFC NOT GENERATINGCFM}
  637.     INLINE $203C, $0254, $0018, $A800;
  638.     {$ENDC}
  639. FUNCTION SoundConverterGetBufferSizes(sc: SoundConverter; inputBytesTarget: LONGINT; VAR inputFrames: LONGINT; VAR inputBytes: LONGINT; VAR outputBytes: LONGINT): OSErr;
  640.     {$IFC NOT GENERATINGCFM}
  641.     INLINE $203C, $0A58, $0018, $A800;
  642.     {$ENDC}
  643. FUNCTION SoundConverterBeginConversion(sc: SoundConverter): OSErr;
  644.     {$IFC NOT GENERATINGCFM}
  645.     INLINE $203C, $025C, $0018, $A800;
  646.     {$ENDC}
  647. FUNCTION SoundConverterConvertBuffer(sc: SoundConverter; inputPtr: UNIV Ptr; inputFrames: LONGINT; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  648.     {$IFC NOT GENERATINGCFM}
  649.     INLINE $203C, $0C60, $0018, $A800;
  650.     {$ENDC}
  651. FUNCTION SoundConverterEndConversion(sc: SoundConverter; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  652.     {$IFC NOT GENERATINGCFM}
  653.     INLINE $203C, $0864, $0018, $A800;
  654.     {$ENDC}
  655.  
  656. CONST
  657.     uppSndCallBackProcInfo = $000003C0;
  658.  
  659. FUNCTION NewSndCallBackProc(userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  660.     {$IFC NOT GENERATINGCFM }
  661.     INLINE $2E9F;
  662.     {$ENDC}
  663.  
  664. PROCEDURE CallSndCallBackProc(chan: SndChannelPtr; VAR cmd: SndCommand; userRoutine: SndCallBackUPP);
  665.     {$IFC NOT GENERATINGCFM}
  666.     INLINE $205F, $4E90;
  667.     {$ENDC}
  668. {$ENDC}
  669. {$ALIGN RESET}
  670. {$POP}
  671.  
  672. {$SETC UsingIncludes := SoundIncludes}
  673.  
  674. {$ENDC} {__SOUND__}
  675.  
  676. {$IFC NOT UsingIncludes}
  677.  END.
  678. {$ENDC}
  679.